/**
 * 这是foo函数的描述
 */
function foo() {}

/**
 * a book
 */
class Book {
  /**
   * @constructor
   * @param {string} title - the title of book
   * @param {string} author - the author of book
   */
  constructor(title, author) {
    /** 题目 */
    this.title = title;
    this.author = author;
  }

  /**
   * # get book base info
   * @returns {string} base info
   */
  getInfo() {
    const info = this.title + ':' + this.author;
    return info;
  }
  /**
   *
   * @returns {Promise<Book>} 我返回了一个promise
   */
  getInfoPromise() {
    return Promise.resolve(this);
  }

  /**
   * This callback is displayed as a global member.
   * @callback stylesCallback
   * @param {Book} book book实例
   */

  /**
   * 样式类
   * @typedef {object} Styles
   * @property {string} color 颜色
   * @property {?string} size 尺寸
   * @property {[number,number]} sizePoints
   * @property {stylesCallback} cb 回调函数
   */

  /**
   * # 设置书的样式
   * @param {Styles} styles - 需要设置的样式
   * @param {[number, number]} sizePoints
   */
  setStyles(
    styles = {
      color: 'red',
      size: 'large',
    },
    sizePoints
  ) {
    this.styles = styles;
    styles.cb(this);
  }
}
/**
 * - 数值
 * @const
 * @type {number}
 */
const count = 10;
export { foo, Book, count };
